Update OS-dependent filepath conversion

Tested in OS X Mountain Lion. Any Windows users
out there to complete the set?
Merge pull request #24 from dougalstanton/master

Update OS-dependent filepath conversion