Refactor specs, use shared contexts

@rimian would appreciate any feedback you have on the test structure.