Atlas

Re built build script to make it more robust and easier to understand. Move some of the source files around to make the folder layout more intuitive.