Fix downloader deadlock.
Fix bug in downloader.
Improve test.

Add timeout to download test.
Code style change.
Remove test code.
Improve download test suite.
Fix Windows file naming.

Closes #331.
Add get_system_filename_slugify
Merge pull request #497 from segfaulthunter/dwfix2

Fix misc downloader bugs