Fix mocks on Windows using \r\n.

Due to the initialization order of the mocks, the tests will still use the system newline.

Re-ordering them forces the tests to always use \n instead.

Also make whitespace in function slightly more consistent.