Initial tidy up of index.js
Fixing up the JS and updating to express 4 and clear up deprecation warnings