Add a command for writing to the log.

Replace current direct calls with command calls.
Begin unit testing commands.