Issue #2840366 by willzyx: Move devel_entity_operation() and devel_entity_type_alter() implementation to a class