Use database store for media library
This PR will use the database for tracking file and folder metadata, and adds the grass-roots functionality to allow extension of media item metadata (#16)
The benefits of using the DB to handle this sort of data include:
- Databases tend to be faster and better at sorting and filtering, contrarily most filesystems must be read in their entirety before they can have the same sorting and filtering done.
- There's no real way for us to paginate the filesystem, whereas using the database could allow us to limit records and retrieve a file list in batches - this will assist with resolving issues with large media libraries (reported several times in the October repo).
- Easily extendable.
The media manager will scan the file system on first use and populate the media metadata table - this has not yet been tested with remote filesystems or an extreme amount of files, but works with around 100 images in a couple of seconds. The intention is to make an Artisan command which can run the scan, but I'm sure optimisations can be made. Subsequent scans will compare the stored metadata with the filesystem and will only update files or folders that have been added, modified or removed.
More details on this PR will be forthcoming once it's closer to completion - it works now for browsing at the least.