Added tests, grunt and minor fixes