Readd tenant support, and fix related unit test
Merge pull request #235 from CloudVPS/readd-tenant2

Readd tenant support, and fix related unit test