Enable building with Js_of_ocaml. Update the way the lexer is invoked to support parsing from a string.