Moved the line processing to a seperate function

This way I can just put the frame decoding for websockets
in the normal callback and still use the already present
line processing code.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>