Some test refactoring and more coverage.
Fixed bug in gruntfile.