Added support for changing the root context and removed permission recursion

Added support for changing the root context.

Removed recursion over data repository as this can be massive and take
decades.