Added caching of min and max arity and the allowed sub-functions in FunctionBase. (#263 List of allowed sub-functions for each function should be cached)