Add UI Core module

Some of this slipped into the previous commit by mistake. Ultimately this just
finishes the decoupling of the editor code from Urwid by introducing a generic
UI class that other code can use to interact with whatever UI is running.

Signed-off-by: Casey Dahlin <casey.dahlin@gmail.com>