JS skeleton, a couple tweaks to HTML to fit

server.js works
main.js a semi-modular semi-muddle