code cleanup/commenting for tok_itr in preparation for submission to ccan