Abstract DeferredQueryManager and QueryManager into a single Monad class