Various tweaks including double buffering.

Solves https://github.com/gavinlaking/vedeu/issues/21