Mathematical/metafunctional programming

Added metafunctional mathematical programming support