Clean up const usage in ui.js broken by SpiderMonkey changes.

THIS HAS NOT HAD TESTS RUN. I am struggling to get lightbeam running locally for really silly reasons. This should fix the errors introduced by SpiderMonkey `const` changes, though.