Minor tweaks for formatting, getting interaction between the buffer and the state working more.
Reorganization of events to make them easier to understand.
Reformatting (again), getting token inserted events to bubble up.