String escaping, tests, formatting