Add connection throttling

This is not ready for merge!

_We_ need to write tests @marcusramberg - but please comment and review the code.

Sorry for doing refactoring in the same branch, but I had a hard time wrapping my head around the code as it was structured.
Let's not talk about speedups in this context, we're trying to slow things down. :turtle: