Random improvements to the code

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.
Merge pull request #1 from legoktm/fix

Random improvements, follow on commit coming afterwards to make some additional improvements based on this input