Move index code into index.js.

Things to test with this--

1) Creating a new course (including error conditions of missing fields, combined length too long, duplicates).
2) Escape cancels form for creating a new Section, Subsection, and Course.

@singingwolfboy Please review.