Fix for file encoding

Files with @ or spaces in the path / url were causing issues with the mime-type detection and with downloading. Fixes #45
Merge pull request #50 from SpiderOak/file-encoding-fix

Fix for file encoding.
(Travis error is due to bower timeout. All tests pass.)