Cleaned up javascript

the whole JS backend has moved into a backend.js file. Gawd, suddenly
the main-template looks so clean O.O