Add callback function to parse

For some package that need callback function support (i.e. use `node.repl` to implement a shell), current package can't pass callback function to `parse`.
After adding this, a simple shell can be easily implemented with `node.repl` and `lineparser`.