Cleaned up and improved comments on ui.js.