Rails4

Rails 4 updates. Also see issue #8