Refactor integration tests.
Add websocket test.