Updated ui.js to follow the requirejs module syntax.