add exit status middleware to map exit codes
add middleware to log exceptions to stderr