Extract channels and router in channel_test

Some code I hae in a previous PR to clean up the channel_test a bit so it improves test suite's speed.