Re-factored and cleaned ui.js, changed some HTML classes to IDs