writecnt modularized, optional inputs set

Tested and seems to write data correctly, even with appended event table
and endtag.

Other fixes and comments to loadcnt/CNT_CHANOPS