(PUP-3511) refactor Application.run for reuse

Extract a small chunk of code from Puppet::Application.run into its own
method so that it can be reused.  This code is currently duplicated in
Puppet Server; the introduction of this new `reset_environment_context`
method enables the replacement of the duplicated code in Puppet Server
with a call to this new method.
This looks for a $confdir/routes.yaml file (by default) which can be used to adjust indirector terminii on a per application subclass basis.  PE uses it, for instance, to set the master facts terminus to puppetdb and its cache terminus to yaml.

Maybe:

"Reads the routes YAML settings from the file specified by Puppet[:route_file] and resets indirector terminii for the current application class if listed."

https://docs.puppetlabs.com/puppet/latest/reference/config_file_routes.html