Add tests and main sink code.