Metaclass support for Python2 and Python3 (c.f. #157)