Support for Rails 4

Updates required for use in Rails 4 applications.