Log manager tests and fixes

Branch contents:
Addition on log entry order tests.
Fix to log entries being written in the wrong order.
Addition of log entry debug tags for special builds used only by the tests.