fixes $or over run in certain scenarios

moved $or code segment to be run during then inside the executeQuery method
adds queryTrail length checks for all operation tests
adds bower grunt task