add "with_constant_class" mixin factory (closes #9)