Mimetype detection

I've added a Mimetype util class with its own mime.types Map and most common file extensions.
It is based on the same logic as the one used by the AWS Java SDK to automatically detect and set content type upon `putObject`.

I've also done a light refactor to the Directory class to remove duplicated code, please double check that I did not make any mistake... ;)