Move congestion control to its own class

It's a general function and it's better to have that particular
complexity in its own place.
5 files changed