formatting
move stuff our of PARSE_ERROR macro that doesn't need to be there
undef PARSE_ERROR when it's no longer needed/valid
normalise defines
check for max @id: prevent malicious schemas from chewing up too much memory