Adding tests for binlog server state.

And fixing a small bug, don't want to serve if state is disabled.