Simplify editors creation with a mixin.

By using a mixin with common code, it's less code duplication and less code to
write when creating editors.