First attempt to filter out multiple tenants.

Added tests and fix tenant filtering.