Tidy up app.js

Hi,

This should be an (almost) entirely non-functional change: it's all just tidy-up in app.js, mostly around the use of semi-colons. There are a few other bits and pieces in there, too (e.g. duplicate definitions, missing var keywords, unused variables, referencing undefined variables, etc), but nothing particularly serious.

The only functional change is that the redis DB now defaults to '0' if not defined in config.json.

Thanks,
Rowan