(#19514) Add $trusted as hash with trusted node data

This adds a new feature where it is possible to opt in to getting a top
scope variable $trusted to contain a hash of trusted data.

The setting that controls this is called hashed_node_data (it is
intended to later also be used for hashed facts as well as the hashed
trusted data; hence its more generic name).

The variable $trusted is only available if :hashed_node_data is set to
true (the default in 3.x is false).

The hash contains the key 'authenticated' which is always set to one of
'remote', 'local' or boolean false. The key 'clientcert' is set if
'authenticated' is set to 'remote' or 'local'.
(#19514) Fix issues in trusted data support when running tests

Other tests were passing nil as node and there were no protection
against nil node in the new indirector code.