Initial code + tests.