Develop 1.8

Added support for __POLYVAL__ in allocation.  Some refactoring to make all the __MATH__ code exist in one place.  Minor fix to allow compliation on Ubuntu.