Update rails integration

Replaces pull #42 (this fork has a different history). Gets 1.1 working with rails taking into account Evan's comments on #42.