Reorganize JS file structure

And edit paths in index.html