Header cleanup

This is a general cleanup of the situation with includes in Geany and also to improve them being scanned by tools like `g-ir-scanner`. The changes here are generally useful so there's no need to make them dependent on that.

I tried to make detailed commit messages but some of the commits are fairly large.

I wouldn't be surprised if one or more of these broke the plugin API or ABI but I tried fairly hard to not do that. It requires testing on Windows and with non-Autotools build systems at least.

Edit:
Since these changes are fairly pervasive, I would prefer not to maintain them in a separate branch for too long. Ideally we could merge them and patch up whatever is needed since it's quite early in the release cycle. I fear perpetual merge conflicts :(