Fixed things for windows.

This makes the tool work for windows.

It'd be great if @cpoulain and @quebecisnice would look at this to:

1) Verify it doesn't break linux, and 
2) Approve it for merging