various fixes to avoid losing records when using flood control downstrea...

various fixes to avoid losing records when using flood control downstream. swap out some packages. refactor external interface. update docs