added emacs autosave files to .gitignore
refactor split index.js into subfiles