Add unit test for parseResource

and a few minor changes.
Use Char where possible in XmppStringUtils
Fix parsing of JIDs that contain a '@' in the resource

Thanks to sandy8925 in https://trac.jitsi.org/ticket/1155#comment:9 for
pointing out some corner cases.