Ported the LiveQuery class.

The LiveQuery class was brought over with a combination of
hand-written code plus sharpened code (some of which was
refactored). There was significant dependent code that came
with, and all of it was either brought in or stubbed out.