Changes to the code after scanning with the Code Checker local plugin.

I'm not sure if this is useful to you or not at this point in development, but this branch is a scan of the repo with the Code Checker local plugin, and changes to the code based on it's results. Tidying, basically.

I've not made every change suggested, as some were about indenting the PHP differently and this would break the flow of the HTML considerably, but I hope you find it useful.