Remove unused function.
Removed module-level functions.
Slightly reorganized UI.

Still not completely happy with the UI of the first tab. Needs work.