fix encoding functions return values

This should fix the problem of adding URLs into the add application form. Fixes https://github.com/opentechinstitute/luci-commotion-apps/issues/38.


To test, create a gateway node and add applications with the following
URLs (all should be accepted):
* 127.0.0.1
* http://commotionwireless.net/test
* https://127.0.0.1/testing
* https://127.0.0.1:22/testing/123.html?foo=bar&amp;baz=