remove unnecessary strlen() and provide more tests for escape()