4.0.6 - Add non-team / non-panel panel tenancy fallback
If the tenant Model is not the defined Team or Program model, it now falls back to trying to guess the tenancy relationship name based on the tenant model of the current panel.
Also fixes a bug where the program relationship was being checked even when use_progams was set to false.