Add in necessary URL encoding

Since this is operating as a library now, we can't trust
implementations of that library to always sanely encode URL
parameters. So, URL encode the units and location when it makes
sense to do so.