Refactored how urls are encoded in the filename. Fixes #13.