Committing before bed.

Nothing really of any interest, mostly code based from another editor,
and some copied directly. Hopefully tomorrow has more progress.