Added the grunt automation and cleaned up a lot of the code.