UI improvements, connection tweaks, general refactoring

Lots of improvements from @oakkitten. Merged with the latest master and tested on my Nexus 5.

There were a few merge conflicts and I did my best to resolve them. There are probably broken things, but I've been running @oakkitten's fork as a daily driver for a few days and it's been stable.

Opening this PR to get more eyes on this code and hopefully get this merged before we diverge any further.