Build for mac os without significant changes

Build for mac os without significant changes of master's code (insead of osx branch). A bit later I can provide signed binary build for osx.