Here's another attempt at merging bryn's provider and block scope capability.

The code integrates cleanly and the tests (including the new tests) run successfully.