Upparcases in jid

Small fixes and tests related to discussion in #120

Note. This pull request goes on top of #281
I don't think so, that's a copy-paste mistake.