Implement namespace serialization.

Might fail with complicated scenarios involving aliasing across modules.
Missing feature: import and export specs.
Implement import specifications for namespaces and functions.
Implement self-assembly-based CLI