First pass at the app foundation

@joshwnj Part of the cleanup fail, sorry.