[major] Finished porting the parser.js to a proper js class.

@swaagie can you confirm or check if i ported everything correctly?