Add .gitignore
Fixed JS syntax errors, tidied up a few bits