Adds end-to-end tests and makes them work.