Move resolver and defmap into ParserContext; rename with_id to add_id_and_span in parser; use TreeMap instead of HashMap for id -> span mapping.