Added game to chat html, much code cleaned up

Much code cleaned up, check master for more details