New URL scheme + bugfixes

URLs are not encoded based on the app's
hostname rather than the app document's
_id field. This both makes for nicer URLs
and allows for a madewith2 badge to link
to the madewith2 app more easily.

Also fixed a bunch of small bugs.