(#6749) Polish the CLI option pre-parse implementation
This improves handling of the pre-parse of the command line to be
non-destructive, which cuts down the volume of garbage generated in the
process.
It also improves testing to verify that we get the darn thing right...
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>