Enormous refactor. Lean frontend.