Add support for new-style declarations in globals.

This patch removes the old, nasty declfuncvar() mechanism in favor of more straightforward parsing of global declarations. Some special care had to be taken to allow adding "void" to old forwards without breaking old-style plugins. I also took the liberty of removing a bunch of stuff related to state automata.

I don't think there's a whole lot more I can QA on this in a vacuum so I'm just going to push it soon and hope for the best.