Clean up script and add Mac compatibility

Compatibility will still need testing.

- #57