Update index.js file structure

Based on the structure from generator-webapp.
Fixes #69.
Merge pull request #70 from NotQuite/master

Replace named functions with anonymous functions