Lots of changes to the JS. Added all the messages among other things