Percent escape strings before creating URLs

URLWithString will return nil if the string contains invalid URL
characters (such as spaces). Percent escape the string before attempting
to create an NSURL using it.
Merge pull request #216 from jamesrhurst/escape-url

Percent escape strings before creating URLs