Added file resource manager.

- Added a file resource manager to keep track of the file sizes, which are the large files, and the number of writers currently accessing files.
- The number of writers to a specific file is being tracked so that if a file is flushed but is still being written to due to some multi-chunk entry, we don't write the footer yet. That way, if any crash happens, the file will have no footer, which will force a recovery and discover which entries have corrupted data.
- The header now contains the filetype: this is useful for the recovery process, which can now ditch large files if they do not have a footer.
- The footer is now being written for large files as well.
- Fixed bug in the recovery process: when reading the file, the padding was not taken into account which was causing the offset to point to invalid locations.