(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.
@hlindberg Do you have a suggestion for a better name for the *reset_environment_context* method?  Maybe *push_context_for_app*?

The motivation for these changes is that we didn't want to have Puppet Server's master "application" derive from `Puppet::Application` -- because there are a number of things that the `Puppet::Application` does, e.g., managing CLI options, that don't make sense in the context of the Puppet Server architecture -- but we do want to ensure that some of the core functionality that derivations of `Puppet::Application` use is likewise used by Puppet Server's master "application".  Where Puppet Server's master "application" is not an instance of a `Puppet::Application`, class level methods for the functionality to be shared seemed more appropriate.

To make this use more obvious, I'm wondering if we should add a comment in the new class methods and in the instance `Application.run()` and `Application.configure_indirector_routes` just before they invoke the class methods.  Maybe something like "Puppet Server's master application invokes these methods, so consider making any changes in a way that Puppet Server will be able to reuse them"?

I'm not opposed to breaking the class methods out into a new module.  Would some extra comments in the code, though, mitigate the concern about the implementation not being obvious enough?