Modularization

This addresses #10.