Reverse parameter order in output_csv() utility

... so that $headers can actually be optional.

Also fix coding standards violations.