Moved settings loading code to correct place (so the messaging agents can be properly initializated)