Cache aware and transient/OGT aware queries (fixes)
Fixes and tests for issues #42, #43 and #44 (query & cache;
query.remove())