parser: Add XML_INPUT_USE_SYS_CATALOG Also clean up catalog resolution and add error handling using the global error. Don't try to look up the resolved URI a second time. Add some comments. Fix documentation.