Spec updates

Various updates to the code and spec to work with newer versions of Ruby & Rails. It has been tested with:

Ruby 1.9.2 / Rails 3.2
Ruby 1.9.3 / Rails 3.2
Ruby 1.9.3 / Rails 4.0
Ruby 2.0.0 / Rails 3.2
Ruby 2.0.0 / Rails 4.0