Ensure external urls are encoded properly. (Issue #158).

-   BREAKING:  While this change will correct the weird encoding
    behavior, this also changes the way `xxx_url` macros work.
-   Do not encode the url bases (`base_url`, `media_url`). Only
    the path component needs to be encoded.