Allow users to enable profiling via a setting

Prior to this commit, there is no way for an end user to enable
the new profiling features other than by patching their source
code or passing an extra query parameter to a web request,
which requires them to know the precise URL / query params / POST
body of the request that they want to profile, as well as passing
all of the necessary SSL-related flags to `curl` (et al) so that
their request can be authenticated.

This commit simply adds a boolean setting called 'enable_profiling'
which can be used to turn on this functionality for all requests.

We should provide more precise ways for users to control this, but
this at least gives them a simple option until we have something
better.
Add support for enabling profiling via HTTP header

This commit changes the new setting for enabling profiling from
"enable_profiling" to simply "profile", so that it's easy to
use it from the command line.

It also changes the mechanism for enabling profiling in an HTTP
request; previously, profiling would be enabled via a special
query parameter; now it is enabled via a header (X-Puppet-Profiling).

This allows it to work easily for any type of HTTP request
(GET/POST/HEAD/etc.) without having to worry about the means for
adding a query parameter.

The commit also adds a check for the `profile` setting during
outgoing indirector REST requests, and adds the header if the setting
is enabled.  This means that the profiling flag will work from
the client as well as on the server.
(#18211) Refactor daemon run loop

This adds a Scheduler module to puppet to handle the daemon run loop. The loop
involves two separate wakeup cycles, in which one can adjust the interval for
both. Refactoring into classes makes it easier to reason about and test the
correctness of scheduling. This should fix #18211.
(#14766) Add splay support to the scheduler

This adds a class that implements a job that runs with a constant offset. It
also adds a factory method to create jobs and uses it in the daemon loop to
implement splay.

Paired-with: Andy Parker <andy@puppetlabs.com>
Merge pull request #1546 from cprice-puppet/feature/master/add-setting-to-enable-profiling

Allow users to enable profiling via a setting
(Maint) Downcased header name in test

The contract of the headers for HTTP requests is to have them all
downcased. The test wasn't adhering to this contract, but the code was.
(#14766) Calculate runinterval from the start of a job

In the fix for #14766 we inadvertently changed the calcuation of runinterval
to happen from the end of a job instead of the start. This fixes that by
making the time dependencies in Scheduler explicit and adds a test that would
have caught this regression.
Merge pull request #1594 from pcarlisle/run-loop

Run loop
(packaging) Add dependency on ruby-rgen to gems, debs, and rpms.