Loads of bugfixes and windows+osx support