Add support for Mac

I was unable to test this on Windows so you should make sure it works before merging