Fixes for startup ordering: don't try to query standalone/domain mode until the UI gets built

Also includes a more robust fix for the ApplicationMetaData bean resolution problem