Revise gem structure and add rspec tests