Refactored and made nicer with Grunt/Jasmine