I'm currently working on this, but I think the list-based implementation depended too heavily on integer ids as indices to be adapted exactly as suggested. I'm putting together a solution based on storing both styles and their lengths (as GStrings) in the hashtable. That way we get the time benefits when we generate the final uri, don't have to maintain parallel data structures, and don't need any auxiliary indices.
I'm currently working on this, but I think the list-based implementation depended too heavily on integer ids as indices to be adapted exactly as suggested. I'm putting together a solution based on storing both styles and their lengths (as GStrings) in the hashtable. That way we get the time benefits when we generate the final uri, don't have to maintain parallel data structures, and don't need any auxiliary indices.