Tags: 4.7
merge branch with many changes:
* in handle_child_scope_results(), check if the query is still
valid. If not, then return.
* do not save ptrs to categories. Instead, use from shell if already registered, else register and then use it from shell.
* feature testing with some new parts and some fixes