4 fixes, 1 enhancement

- fix: include EOF marker in buffer length calculation
- fix: correct offset for header terminator
- fix: don't turn all falsy values into zeroes
- fix: append EOF marker at correct offset
- enhancement: structure() optionally accepts passed-in field metadata