Refactor logparser.js [WIP]