IdoQuery: fit new DbQuery implementation

Just a bunch of small changes, more to come. Fixes customvar handling
and is now able to handle the new Filter implementation.

refs #6418