Tidy up the javascript formatting