added capybara gem
refactored the app, cleaned up old code, added test