Added initial multi-tenant mechanism, wip
added tests for multi-tenant behaviour