Traversal fixes for unit tests on #972; Fixes to where/having array handling from PodsData::query_fields