Fixed RSpec deprecations

Fixed some RSpec deprecations [1].  This should make the transition to RSpec 3 easier.

1. stub! is deprecated.  Use `allow(object).to receive(:method).and_return('return value')`
2. mock is deprecated. Use `double` instead.

[1] http://relishapp.com/rspec/rspec-mocks/docs