fix copy-paste error
2nd draft to fix design issues raised by rusty

the first draft of this module made it impossible for
a user of the module to prevent truncation of tokens
in the case where a token exceeded the length of the buffer
passed to tok_itr_val. these changes rearrange the code
so that the length of the token is known before a call
to tok_itr_val. since the length of the token is known
before hand, an appropriately sized buffer can be allocated
for each token before making a call to tok_itr_val.