Fix query notifications on first connect

Fixes #284
Clean up buffer model a bit

* use type local variable to determine whether to indent
* local_variables is not used, don't export/save it
Merge pull request #292 from glowing-bear/fixinitialhighlight

Fix initial query notifications