use explicit IDs for connection to mqlight to make demonstration easier to understand.
tidied up some of the javascript to improve style