(#23373) Support selecting the section

The --section option to the subcommand now allows a specific section of
the configuration file to be manipulated.
(#23373) Have config parsing use IniFile's sections

Since the IniFile code now tracks the sections the config parsing can
utilize it and simplify its flow some
(#23373) Provide a more structure config file parse

The previous parsing of the config file was a hierarchy of hashes, which
made it hard to discover what the parts were. This changes it to use a
more structured system and lays the groundwork for moving lookup
behavior elsewhere.
(#23373) Pull apart settings into a few more classes

The monolithic settings infrastructure is really hard to work with. In
order to implement the functionality for puppet config print to reliably
be able to print the value of any given section of the configuration I
need to be able to split it apart from the very static structure that
exists inside puppet. This takes a step in that direction by starting
the process of extracting the lookup logic into smaller classes.
(#23373) Add section control to the config print action

This exposes the lookup facilities that are used inside the settings
infrastructure in a manner that allows looking up values from the
perspective of individual sections. This functionality is then exposed
to the end user as the --section option on the `config print` subcommand.
(#23373) Reuse existing section headers

Previously the setting manipulation code would always create a section
header if the setting was not already present in the file. This changes
it to reuse and existing header if the section is present but the
setting is not.
(#23373) Check for minimal use of [main]

When inserting settings into [main], there isn't any need to add a
section header.
(#23373) Don't set metadata when it isn't supported

Not all settings have metadata, this prevents the settings code from
trying to set it on ones that don't support it.
(#23373) Use puppet config set in tests

This uses puppet config set to modify the puppet.conf in a test rather
than writing the puppet.conf file in place.
(#23373) Don't apply all metadata

The previous code would always apply all of the metadata that it got
from the configuration file. This caused unused sections to override
default metadata, when the section of the config file that was really
being used did not specify any metadata. Instead of trying to apply
everything, this now just tries to use the data from the section that is
currently in use.
(Maint) Remove unused code
(#23373) Restore 'all' functionality

The "puppet config print" command used to take a special "all"
parameter, but it was lost at some point during the refactoring of the
implementation. This restores the ability to print "all" settings.
(#23373) Only parse section lines once

The previous code would parse all of the settings of a section for each
section header. This meant that if a section showed up in the
puppet.conf twice the settings in that section would be parsed twice.
This didn't cause any behavioral problems, but is inefficient. This
makes sure that we only look at unique sections names. Instead of
putting this logic in IniFile it is in ConfigFile in order to preserve
IniFile's somewhat naive view of the world.
(Maint) Fix deprecation message to point to the right alternative
Merge branch 'pr/2158'

* pr/2158:
  (Maint) Fix deprecation message to point to the right alternative
  (#23373) Only parse section lines once
  (#23373) Restore 'all' functionality
  (Maint) Remove unused code
  (#23373) Don't apply all metadata
  (#23373) Use puppet config set in tests
  (#23373) Don't set metadata when it isn't supported
  (#23373) Check for minimal use of [main]
  (#23373) Reuse existing section headers
  (#23373) Add section control to the config print action
  (#23373) Pull apart settings into a few more classes
  (#23373) Provide a more structure config file parse
  (#23373) Have config parsing use IniFile's sections
  (#23373) Support selecting the section

Closes GH-2158
(maint) Make [] operator flatten keys for all LHS types except hash.

It is expected in the Puppet Language that it is possible to write:

$x = ['a', 'b']
SomeType[$x]
(maint) Fix failing test for access operator since array is now ok
(PUP-910) Convert args from 4x representation to 3x

This is a partial solution that is ok as long as there are no functions
written that wants to use the 4x representation.

To be changed in 4.0.0 where functions should be able to opt in.
(maint) Make 3x conversion use verbatim types for non Host/Resource.
(maint) Make Resource::Type use the CodeMerger strategy

This makes the Type.merge method use the CodeMerger instead of
relying on that code knows how to merge itself with any other kind
of code. The CodeMerger is parser specific and is obtained from the
ParserFactory. This way the choice of parser is hidden from the
Type.merge logic.

This also changes the CodeMerger.concatenate to only be responsible
for the actual concatenation (it used to also create a HostClass called
'' as it was used in only one specific use case).