Fix escaping/unescaping for muc/private rooms

This is a merge of branch `wip-escaping-fix` and
should fix a big part of the escaping/unescaping
issues.

Although there still might be some
issues open, I'll merge it in and we can fix this
directly in the dev branch.

Fixes #198, #197, #114, #83 and #76.