token, kex: Add functions to handle tokens lists
The added functions allow splitting chains of tokens separated by a
given character (usually ','), and extracting matching parts between two
chains of tokens.
The previously existing functions in kex.c were replaced by the
Signed-off-by: Anderson Toshiyuki Sasaki <firstname.lastname@example.org>
Reviewed-by: Jakub Jelen <email@example.com>