Trying to add Rails 3 compatibility and tests