Introduce isEmpty() and avoid problem with angular.equals(a, b)

Really all we want to know is if the `queryJson` is an empty object or not, and due to a (ongoing) bug in angular.equals regarding values of value undefined, I am simplifying and avoiding the issue.