Refactored parser.js to introduce StmlParser