WIP. Got tests passing.