removed events.js dependency and included neccessary code in the parser