Replace parser handler code with dispatcher interface code

Use an interface to define the repsonse callback functions and send the session class to the
dispatcher (parser) class at the moment of dispatching responses, instead of sending the
session class to the parser class as a void pointer at initialization.