Move parsing function into separate module;
Added an object oriented accum that would allow to create event hooks in future.