Replace logger with a filter.

Replace the logger method in the `Machine` with a `filter` method
provided by the test. The `filter` method can perform logging. It can
also swallow messages, or duplicate them.

Closes #138.