Move all the js code into a class
Further break JS into classes.