Added __future__ imports
Use the range function from six
Fix metaclass use