Big refactor

Hi,

I needed to access the `mtime` of entries so I started looking at the code, and… I ended up rewriting almost everything. :laughing:

The work isn't finished yet, for example I haven't adapted the test suite, but I'm not sure when I'll have the time and motivation to complete everything, so I'm opening the PR now.