Made capybara wait for tests to finish.

I did this so that when testing on the command line the Capybara session
wasn't closed before the JS had finished outputing the test results,
especially in scenarios where we are testing async stuff.