Fixing the UI and unit tests. Refactored out static UI elements and removed a few hard dependencies.