Updated JS file to actually call the main loop.