Add a headless mode for tests