Improve Windows compatibility

Still doesn't work though...
Only add /usr/local/bin path on OS X
Support both kinds of line endings
Only copy env variables on OS X