moving js out of index.html

might eventually convert to coffeescript, we'll see