Formatted with `artistic style`

I used artistic style (the `astyle` command) with the following options:
--style=attach
--indent=spaces=4
--convert-tabs
--pad-oper
--pad-header
--unpad-paren
--align-reference=type
--add-brackets
--indent-col1-comments
--close-templates
--max-code-length=79
--lineend=linux

Hopefully a consisten format will make the code easier to work on.