change isAggregate bool to FunctionInfo.Type

in order to also differentiate between Scalar & Predicate
throw proper errors if predicates are used outside WHERE clause