fixes #206 Factor out inner classes to be their own classes. Relax some
abstractions and strengthen others, with an eye for simplicity and
consistency, not over-encapsulation.