Random improvements

Mainly fixing documentation, adhering to MediaWiki code conventions, etc.

Left a few @fixme's where I saw things that didn't look right but wasn't sure on how to fix them.
The global declaration is present twice, so I removed one of them. See line 62.