Simplify convert_to_hex function.

Separate the two tasks of the convert_to_hex function by creating a new function string_to_card_list.