Begin Rails 3 work

This combines some Rails 3 work from @meineerde and me, this is a beginning but still needs a lot of work and is far from stable.

Current Ruby and Rails status: The current targets are Ruby 1.9.3 (1.8 is EOL) and Rails 3.2-latest. Ruby support can be expanded to later Ruby versions once it's stable on 1.9.3.