First draft of iterator-based scanner-parser interface

review @xeno-by