Unit tests for the tracing system

This patch adds some unit tests to the tracing system to ensure that everything is working as expected.

The patch also includes a tool to store syslog traces in memory.