FIX added check for tenant==null
FEATURE improved TenantHelper
FIX use TenantHelper for accessing TenantContext
FIX fixed database query