CRLF line ending support and Windows state file replacement

This should fix the following:

* State file was not being replaced correctly on Windows.
If the .old registrar state file existed then the registrar state file replacement would not work (as os.Rename does not overwrite under windows).
* CRLF line endings in log files should now be supported - CRs were not counted when calculating the offset of events, newlines were always assumed to be 1 character.