moved the main functionality to a function to make it testable
added some tests
added test with spaces in path
more natural quoting
Merge pull request #22 from janosgyerik/testable-and-some-tests

Testable and some tests
Thanks @janosgyerik