parser: finish implementing parser, add unit tests