Added function that decomposes a list of <li> elements (with category classes) into a list of categories