Code reorganization

Reduce chance for circular references when including classes.