Numerous fixes and improvements

* Many escaping/unescaping fixes
* Restlet version upgrade
* Other bugfixes