Refactored ensure() and ensureNot(); added throwProvidedException()

This is another unrelated change.  Please separate.