Added Gruntfile and seperate executable from code

wrapped the code in a function that is called by the p2 script, this
allows us to jshint the code without having to deal with shell issues
0.0.2