Adding end callback and logging option to indexManager.
Fix to return err in count query, updated comments.
Added new tests of queryobject.