Don't allow index route for batches.
Reorganise JS a bit.

- Move to bottom of page.
- Split into two sets of JS (application and database)
- Call database set up function as function rather than detecting variable.