Better tests for daemon codebase