Revert "Revert "Change exit codes to #define constants.""

This reverts commit 5016b34a331906f6b330356b10114b04fcd40e2d.