Rails 4.1.0.beta1

A couple changes to run on latest rails. Build still has a couple of failures, I believe they are related to the destroy action on dependent records or to the order the tests run, couldnt figure it out yet.