(#17190) Re-introduce environment for catalog compile

Commit f64e0a94c60506eec44645b07c36ff996ee2b5cd accidentally removed the 
pass-through of `*args`, which removed the passing of `:environment` to the
Puppet::Node indirection. This adds a test that would have failed and
restructures the code so that the mistake would have been more obvious.