Added some debugging; and the force_resource_sync handler.
Early solution for sync-on-demand, also some groundwork for the login-from-any-subdomain issue we're having.