Add link down/up and connection state checks.

Add the analyser which controls the relay to the topology. Add tests which drive the relay and check the expected state.