add Gruntfile.js
clean up a bit, fix state issues