Cleanup and add support for FATAL in the logger

Also fix setprogname