Adds support for externalFileEntities, and some more verbose error messages.