Added loads of grunt stuff and did some refactoring