Fixes #7. Fixes #4. Organizes js files.