added mortal switch so user can choose whether to die on failure or just log failures. Profile optimizations.