a couple things:

- added global debug logging (if debuglog is defined in main-vars)
- continued converting functions to pay attention to data.status

Signed-off-by: William Rockwood <wrockwood@tadl.org>