Clean up function syntax

Remove space before ( in function names. Put { on new line.
Make tests static.
Correct indentation and wording of comments.