Initial progress on single editor template merge with upstream

Styles are still off, but the behavior is now almost in place.