Use polynomial abstract base instead of template.

Speed up import of polynomial classes by deriving the classes from an abstract base rather than compiling from a template generated class on import.

The polynomial classes are no longer derived from PolyBase but from ABCPolyBase. This is a small backward incompatible change, but I don't think it will cause problems. The polytemplate module is also deprecated.

Closes #634. Closes #3639.