Large commit with current existing code base.
The application mostly works, but for ease of
review I'm merging a lot of my commits and will
then do more consistent commits on top of this.
This code base is ready for review as a whole
and is unlikely to change drastically anymore.
Change-Id: Iecf75c44da28d3be14964a205cbe44dc3d9d5619