[WIP] Fixes to mimetype failures in #1534

Adds a default of application/octet-stream where the mimetype was not discernable.

During environment setup also calls a new function to preload some mimetypes based on extensions that are not often found in /etc/mime.types

Still needs tests.