Clean and consolidate export code #190

(see previous commit)

Simplified things somewhat. Still needs a way to factor out
the updating of the dynamic types.