Implemented the core functionality.

On connect/disconnect and all UI works as intended! Hurray! Just in
time for WWDC.