Detect leaked constants under Msf::Modules

MSP-11130

Detect constants leaked under Msf::Modules after the suite completes.
Log leaked constants and fail rake spec on leak

MSP-11130

Instead of printing the leaked constants to stderr, log them to
`log/leaked-constants.log`.  In task action for spec, read
`log/leaked-constants.log`.  If it exists, print each leaked constants
(and it appropriate it's module full name) and then exit with 1.  If the
file does not exist, do nothing.
Extract Metasploit::Framework::Spec::Constants.full_name

MSP-11130

Extract method to convert child constant names to module full names so
it can be reused 'Metasploit::Framework::Spec::Constants tracker' shared
context.
Filter non-loaded-module constants from leaked constants

MSP-11130

Constants from library Modules or Classes should not be reported as
leaked since they have been required and should be persistent between
spec runs.
Extract Metasploit::Framework::Spec::Constants::Suite

MSP-11130

`Metasploit::Framework::Spec::Constants::Suite` extracts out
`LOG_PATHNAME`, `configure!`, and `define_task` as those piece are
specific to handling constant leaks for the entire suite.  This is in
preparation for `Metasploit::Framework::Spec::Constants::Each`.
Detect constant leaks in individual examples

MSP-11130

`Metasploit::Framework::Spec::Constants::Each.configure!` will set up an
`after(:each)` callback that will fail the example if there are leaked
constants.  Leaked constants are cleaned up to prevent misattribution.
Metasploit::Framework::Spec::Constants cleaner

MSP-11130

Shared context will calls `Metasploit::Framework::Spec::Constants.clean
after each example.
Rename shared example file to match name

MSP-11130
Clean up leaked constants

MSP-11130
Fail `rake spec` if leak tracking unnecessary

MSP-11130

Fail `rake spec` if
`Metasploit::Framework::Spec::Constants::Each.configure!`'s
`before(:each)` does not clean all leaked constants and if should be
removed so that it does not interefore with future specs.
Print when Metasploit::Framework::Spec::Constants::Each before(:each) cleans

MSP-11130

Print to stderr the full description of the example when
`Metasploit::Framework::Spec::Constants.configure!`'s `before(:each)`
cleans constants as it may clean constants that are leaked from the
class level at parse time.
Log constants leaked before and after suite

MSP-11130

Some constants can be leaked before suite if module are loaded during
spec loading, such as if a framework instance in made in the context
body of a spec instead of in a before callback.
Fix constant leaks in Msf::EncodedPayload spec

MSP-11130

Switch to using 'Msf::Simple::Framework' shared context and explicit
module loading instead of loading all moduels to just test with one.
Extract 'Msf::Simple::Framework#modules loading'

MSP-11130

'Msf::Simple::Framework#modules loading' defines
`#load_and_create_module`, which takes the :ancestor_reference_names,
:modules_path, :module_type, and :reference_name of the module whose
ancestors to load and the reference name to create. A default modules
path, the first 'modules' path for the Rails application is available in
in the `#modules_path` let.
Complete documentation for 'Msf::Simple::Framework::Modules loading'

MSP-11130
Derive ancestor reference names from reference name

MSP-11130

For 'Msf::Simple::Framework#modules loading''s load_and_create_modules,
don't require `:ancestor_reference_names` when the `:module_type` is not
payload as the one ancestor reference name will be the same as
`:reference_name`.
Default modules_path

MSP-11130

Default `:modules_path` to use the `#modules_path` left for
'Msf::Simple::Framework#modules#loading''s `#load_and_create_module`.
Fix derive_module_ancestor_names

MSP-11130

Wrap :reference_name in an Array since :ancestor_reference_names is
expected to be an Array.
Fix Msf::PayloadGenerator spec constant leaks

MSP-11130

Remove the constant PAYLOAD_FRAMEWORK as it leads to a
Msf::Simple::Framework instance that is not cleaned up and loads modules
prior to the beginning of the suite run.
Fix constant leaks in Msf::Util::EXE spec

MSP-11130

Remove global $framework as it loads modules prior to suite run and they
are not cleaned up.