improve bibtex error handling and some missing macros/types 

Probably needs a comprehensive review for better error handling through all of this parsing -- in fact, could we just use an existing, more robust BibTeX parsing library, like bibtexparser? -- but this change has enough fixes that I could actually load my .bib file once I converted it to ASCII.