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.