MDL-42616 filelib: Use database table for MIME types (1/3)

Change from the existing hard-coded array of MIME types to a table
stored in the database, which can potentially be modified.

This change will slightly reduce performance by adding a single MUC
lookup for each page that uses the list. However this impact can
be minimised by using appropriate MUC setup, such as ensuring that
the data is stored on a memcache instance on the same server.
MDL-42616 filelib: API to modify file type database table (2/3)

New API functions in core_filetypes class allow the database table
to be modified.

Also extended filelib test to add tests for the functions modified
in the previous commit (the tests need the new API functions).
MDL-42616 filelib: New user interface to edit and add file types (3/3)

New admin tool tool_filetypes which uses the new API to add and
modify file type definitions.