Rewrite Abstract Factory, with inline documentation and new unit tests.