Revert "Merge branch 'John'"

This reverts commit 93d6864d23785130d476298797b38419e0bb3f1d, reversing
changes made to 0b3ade985e8c119ef0ef86982bc7a6e4ffc0d361.
main.js cleaning

removed parentheses from 'if( type( variable ) !== "undefined") )'
statements
main.js added state

 trying to work out client disconnect and then starting a new instance
of the game
Merge branch 'John'

Conflicts:
	js/main.js