Add tests for modes, and start to correct docs