Some more general cleanup, basic testing and coverage in place.