Move ui.js to its own file.