Moving locale setting and registration to the container

This makes it easier to use in test mode