starting http state machine cleanup, making hookable functions for GDB (macros cant be debugged).