Refactor; moved files
builds on OSX