Pods 2.5 optimizations work

This is a general PR for all the 2.x-optimizations work done so far by @jamesgol / @pglewis; to ensure we can see a full big picture of the changes. This will make it easier to review everything as it currently is (or becomes) and I can comment on the difference lines.
I wonder if this should instead be a `if ( ! empty( $params->having ) )`