Fix a ton of bugs in request handler

Some of them caused by the bytes/str difference in python3
which causes a lot of brainfuck in the payload builder
and request gathering methods.