Add basic size inference.

sizing is sloppy; since rule references cause a duplicate to be constructed, resolving `root` does not resolve referenced rules. temporary workaround is to resolve all rules by name so all rules have a size, but in the future I'll be looking to reduce duplication on rules and size information.