Misc ESQuery additions and bugfixes

@NoahCarnahan @nickpell  These are some misc changes I'd like to get in, they came up as part of a feature branch, but the fixes shouldn't be blocked on the feature.
(Tests pass locally, but couldn't hurt to wait on the build)