Refactor module providers for subclass convenience fun.

This change should make it easier for subclasses to create variable
bindings. Specifically, for example nodyn's `NpmModuleProvider` needs to
create a `__dirname` free variable that is scoped to the require() call.