Add gruntfile and handle undefined functions