Adds compatibility for Rails 4

Rails 4 now uses a `secret_key_base` value on `Rails.configuration` and has deprecated `secret_token`. These changes add compatibility around this, as well as some initial tests.