r6519: move string handling functions to a seperate file