Rails3

Makes changes to allow this to work in Rails3 and additionally loads it via a Railtie.