converted functions to use "buffer" struct

this method seems much cleaner than trying to keep track of the
size and pointer separately. t_match_string and t_match_token
still use separate values, though, because they can be passed
parameters other than those from buffer structs.