! Refactor error analysis and reporting infrastructure for cleanliness and correctness

Also introduce `ErrorFormatter` for more flexible parse error rendering.