Use six add_metaclass to provide backwards compatible code.