Rails 4.1 compatibility

Ironing out all the kinks for Rails 4.1 compatibility. I've been testing these changes with Rails 4.0.4, as well.