instruments organization; add shutdown handler for dealing with trace dirs; more cleanup