Removing ActiveRecord dependence. Adding rspec tests