Extract warning methods into module

Pairing with @samphippen

Refactoring warnings for PR on RSpec core https://github.com/rspec/rspec-core/pull/1253