Added output logging so uncaught exceptions or illegal input is logged for analysis
Fixes license headers