cleans up some javascript code and adds some feature tests with capybara
adds some more feature tests