Initial commit of refactored parser core