Feature/unit tests and polynomial refactor

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