Explicitly refer to metaclass, as __metaclass__ no longer exists
Extended _is_number check to support numpy and gmpy number types

In additional to the usual check, an object is considered a number if it
has both the __int__ and __add__ methods.