Refactor how a dir contents are parsed

This introduces a tokenizer method that will be more effective when
adding more key-value pairs to the dir's log (apart from the name).
Add a method for setting metadata on a dir's entry
Use a struct for caching a dir's entries

This is so it can also store the metadata, not only the entries'
names.

This change requires that both a map and a set are used to
access the entries. The former for getting the respective DirEntry
struct, and the latter for returning the ordered list of entry names.
Set the entries' metadata when parsing a dir's log
Add a method to get the metadata for a dir's entry
Add a method to check if a dir's cache has an entry
Add a method to remove metadata from a dir's entry
Refactor part of the index functions to share code

Because portions of the code were duplicated.
test: Add unit test for the dir entries' metadata