Add unit tests for escaping and unescaping