files.js: add more checks if structure is correct.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>