Updated config to reflect new config structure
Big refactor and tidy
Merge branch 'api-restructure'

Conflicts:
	app.js
	lib/db.js
	lib/routes.js
	lib/tools.js