Add string-returning overloads for encode_list and encode_dict