Major rewriting. Moved things around in packages. Added a framework for dynamic child management.