Urlencode the links output by the code

If we don't urlencode the links output, then the malformed urls generated can trip up web firewalls.
Merge pull request #11 from marsdd/master

Urlencode the links output by the code