Refactored the code that runs the NetworkReceiver into further classes and traits to make them more testable.