Custom malloc and error handling

- Added nmalloc which is a error-checking, pointer-nulling version of malloc.
- Added die() which is a function used to terminate the program when an unrecoverable condition happens.