Begin porting back to Python2/SAGE
Fix metaclass for python2