PHANTOM-75: Restructuring Query builder mechanism to simplify sharing methods and reduce code size.