Move custom rf class outside the combsimp definition

This fixes, or rather, works around, a bizarre caching issue involving classes
defined inside functions.  See the discussion on pull request #1710.
Faster ``minpoly`` using composed sum.

Added power series functions on "ring.PolyElement" objects.
Fixes #2676 : Convert Matrix to NumPy Array with NumPy dtype

Exposes dtype to the user. Default dtype is 'object'.
Rename d_type to dtype
Added tests for matrix2numpy
Update mpmath to 0.18-a1

The paths haven't been adapted yet.
Fix mpmath imports
small changes in the documentation; used ``as_int``
initial attempt
working on
Fix whitespace issues in mpmath
Use mpmath 0.18 final instead of 0.18-a1
Update mpmath docs
Fix mpmath index files
tests pass, refactory in progress
fixed substitution bug and added tests
hash function restored
merged with master
fixes
metric bug fixed, various refactories