files restructured, fix osx/linux support