(#17190) Create Profiler components

The existing Puppet::Util#benchmark method makes it hard to easily put
in place because it does not retain the return value of the block
measured. It also does not give great control over whether or not to
profile, nor does it provide nesting information. This adds a profiler
structure that incorporates all of these features.