Add tests for escaping and unescaping JIDs and cropping strings