Saner dmg code organization.

"dmg" is now the layout-enabled usual DMGs, since they will soon have
more functionality around them (signed applications).  "sdmg" is for the
simple (or "source") DMGs, which are just plain containers for a
directory.  Also use a flag to avoid the stupid dynamic scope hack.
Added an optional hook script to run on the to-be-distributed directory.