Add Support for Rails 4
Don't lock Rails dependency to Rails 3. Fix broken tests, and add configurable configuration.