Another early restructure, the first unit tests.