Move throttling to its own module

Implemented a faster, generic, throttling algorithm outside of
generate_output().