Replaced all occurences of (int,long) with Integral

Since python 3 doesn't have a `long` type, I replaced the int/long type checks with one for an Integral, which effectively does the same thing. I should note that for python versions greater than 2.4, integer is largely unconstrained, such that it might be enough to just test for `int`. For instance, on my machine:

```python
>>> import sys
>>> sys.maxit
9223372036854775807
```
In other words, 2**63 - 1 on a 64bit machine. 2**32 - 1 on a 32bit machine. If there isn't a chance that such high numbers will ever be reached, I can safely change this pull request such that all checks for `(int, long)` check for `int` instead.