First complete implementation of new ui

Works towards #3. Still need polishing.