Multiple cleanups and improvements; source module script instead of exec'ing.