Rails upgrade to 3.1

This upgrades the code to Rails 3.1 as well as takes advantage of the asset pipeline.