Rails 4

Make errbit rails 4.0.x compatible.
r. @stevecrozz

After merging this, I will do a series of cleanups, and move as soon as possible to 4.1.x.