Completed flow control

Fixes #8
Improved SETTINGS handling