(PDF available here: http://pespmc1.vub.ac.be/ASHBBOOK.html )
Cybernetics might be the "missing link" for what you're talking about.
I'm looking more for a theory of modules and relationships. Something that can formalize the ways we organize code.
It sounds like CT is what you're after (to the extent that we have it at all yet...)