better js and clean gruntfile

Add an OOP model to main.js
Clean and optimize the Gruntfile