Improved string token parsing. Added unit tests