implemented where clause splitter

I think these functions could be moved to TestingHelpers  and you can also make use of createFunction from the testing helpers