Backend: For each document, keep in memory the number of pages and the labels (--> caching)

Signed-off-by: Jerome Flesch <jflesch@gmail.com>