Feature/unit tests and polynomial refactor

Refactored  the BasePolynomialFunction and OptimizedPolynomialFunction classes, and added unit tests  for homomorphic function generation.
This entire function can be removed.