Massive refactor

Make a base handler so that sublime/vim can both use common stuff.  This also requires a wrapper around buffers/views. Shit is broken.