Refactoring the build process

Starting to work on the build. Next steps are to actually remove the Makefile altogether and then do something about simplifying the Gruntfile.