Fixes #7961: Able to view the Errata in the LIbrary Environment

Note, this will require some API work to get the counts, but opening for initial review.
I know this isn't really related to your PR (and is more related to the bastion generator PR that I already ACK'd) but I prefer that we keep `latedef` on because otherwise we may end up getting some nasty bugs where functions or variables are hoisted unexpectedly.  

Can we enter an issue to change the generator to put the function definition first?  I think preventing potential bugs with this check is worth the minor decrease in readability.