Adt string parser fixes

While writing a prettyprinter for the string parser, i found several bugs that were affecting the correctness of the parser. This branch fixes these and adds a simple prettyprinter.

cc @animehunter