Deal properly with debug directories.
Rig up built-in test system.