Implement mock and debug modes (version 0.9)