Get all lib functions from lib, not pkgs.lib, in modules
modules.nix: Generate the extra argument set from the configuration

This allows for module arguments to be handled modularly, in particular
allowing the nixpkgs module to handle the nixpkgs import internally.
This creates the __internal option namespace, which should only be added
to by the module system itself.
nixos: Don't evaluate twice to get the value of config.nixpkgs
evalModules: Add internal option for the check argument
Add comments about the module system interface

Ideally the module system could be configured pretty much completely by
the contents of the modules themselves, so add comments about avoiding
complicating it further and possibly removing now-redundant
configurability from the existing interface.
Move most extra args out of eval-config.nix
Add comment about limitation on __internal.check
Allow __internal.check to depend on other config values
Allow lib and import settings to be specified for evalModules
Fix compatibility with old nix