Move index code into index.js.
Merge pull request #1331 from edx/christina/index

Move index code into index.js.