core: move redundant and identical implementation of a str_list type to core