Tweak to improve the performace of the User-defined function for allelic frequency.

Its better to move any applicable WHERE clauses out of the UDF and into the input specification.