remove debug code
fix test
fix tests that were randomly failing

This was caused by Capabara ignoring ajax requests that don’t modify
the DOM. Thus, Capybara would return/continue, even with the request
still pending. If the server was fast enough, it would work correctly
though. https://coderwall.com/p/aklybw is a very nice writeup.