Working with South enabled!

South changes INSTALLED_APPS setting on the fly, so we need to first look up
which shared_apps and tenant_apps we need right now and only handle those
during the sync.
If the tenant model uses migrations, querying all the tenants will fail on
`sync_schemas` command because the tables for that model is not created yet.
(It is only created after south's `migrate` command.) I handle this now by
checking for ProgrammingError exception (because that's what Django throws if
you want to query a non-existing table) and warn the user to apply the migrations.
Logically reorganized code, fixed some logic mistakes.

Tried to put codes to the logically most fitting place;
shared_app models, tenant_apps models, and shared_models are now three different properties.
Select models to sync in sync_schemas.
If no SHARED_APPS, INSTALLED_APPS will be used.
If no TENANT_APPS, INSTALLED_APPS will be used.
If no SHARED_MODELS, connection.shared_models will be empty.
If a model is in SHARED_MODELS and it's app in TENANT_APPS,
the model's table will not be created on the tenant's schema,
but the foreign key will be forced to the public schema.