(PUP-2344) Fix issue with inter-module calls (visibility error)

This fixes the problem where inter-module function calls could
not be made. The main problem was that a function when loaded
was given the public loader and thus had no visibility into its
containing module's dependencies.

The design is that module resolution should be on-demand, only
when something actually needs the proviate loader should it be resolved.
The resolution is triggered by asking for the private loader,  but no
such call was made on the call-path when a function was loaded.

This commit adds the notion of private_loader to the loaders (those that
do not have one respond with self). Those that do either provide the
private loader explicitly (environment loader), or on demand (by
obtaining the private loader from loaders).

This change required tests to be modified since the logic now depends
on :loaders being bound in the Puppet context
logic that made this happen on demand was not implemented
(maint) Remove scaffolding test

This should be tested elsewhere or simply depended on.
(maint) Clean up loader tests a little

Just a bit of combining multiple asserts into one
(PUP-2344) Extract methods to make flow clearer

There were multiple levels happening in the different methods and some
LoD violations. By extracting some methods onto the LoaderModuleData
class and pulling out methods for the different kinds of dependency
loader creations the flow becomes a little clearer.

This also removes the TODOs since I think that the current
implementation is the right way to go.
(PUP-2344) Inject environment into loaders

Having code depend on the "current environment" has lead to trouble in
many instances. Having the loaders be given an explicit environment is a
much safer way to proceed.
(maint) Remove unused "create_loaders"
(maint) Unnest tests for loaders

Having extra nesting in tests just makes them harder (for me) to read.
This unnests and changes around the asserts a little to be ever so
slightly clearer.
(maint) Clarify tests for loaders

As I went through the tests for loaders it seemed like there was some
overlap and some that were not clearly stating their purpose. This tries
to put clearer names on them and also shows where a test is missing:
what is visible to a module that *does* have metadata.
(PUP-2344) Remove dead code path

This was trying to make a decision on whether the environmentdir
setting is nil. Unfortunately it is always nil because it doesn't exist.
So this removes the dead path where it is not nil.

This code needs to be redone anyway because the environmentpath setting
is more complicated, and probably shouldn't be used here anyway.
(maint) Remove unused method

A comment was added, asking if it was unused. Yes, it was unused.
(PUP-2344) Use the public loader for dependencies

This fixes the problem when only certain dependencies are visible.
Before it used "loader" which is a method that doesn't exist anymore.
Changing it to public_loader gets access to the publicly visible parts
of the other module.
(maint) Remove dependency on context system

I'd like to keep the pops code as independent of the other puppet
subsystems as possible. In this case the loaders were dependent on the
context system to get the overall loaders. Instead of relying on this
external system of global information, the loaders instance can just be
passed into the constructor instead. This also has the advantage of
removing a lot of context overrides that were being done in the tests.
Merge pull request #2587 from zaphod42/issue/master/pup-2344-problem-calling-between-modules

(PUP-2344) Fix issue with inter-module calls (visibility error)
Merge branch 'master' of https://github.com/puppetlabs/puppet