Test coverage

This PR is not complete at the moment. The goal was to improve test coverage through separating concerns. The connection logic is now in a separate module. The incoming webhooks have been moved to make room for outgoing webhooks. The test coverage has been increased. The interface has changed slightly and that needs further documentation and smoke testing.