Add a BaseMixin class with some utility functions.

Port the mixins to use them.