rewrite mimetype detection
Merge pull request #108 from dereuromark/cake3-debug

rewrite mimetype detection