Cleaned up exiting of the program.

Function `cleanup` that calls `disp_end` now registered with `atexit`. `disp_end` not called
otherwise. Places where `fatal` should be called actually calls `fatal` now