Add publish task to Gruntfile
Refactor into IIFE for easier config