Nicer error formatting

Pretty-print errors and warnings, as well as correctly report parser errors and
warnings using the new format.