Move to rails 4

Move from Rails 3 to 4 and add RSpec tests