Make Rspec 3 compliant

I don't think this pull request is ready yet, but just an illustration of the changes that I think need to take place. See #1122.

Change explicit use of `example` variable to using the block value that
is passed in to examples and before/after hooks.