add debug macros, sanity checks, misc housekeeping

- add zed_debug macros
- remove unnecessary __inline declarations
- add -Wall to gcc flags
- 2D arrays are now allocated, free'd properly
- all dynamic memory assigned to NULL first
- add time.h to includes
- sanity checks on all file/memory operations