6.x -> 7.x port with code style enforcement
Ported SQL call to get mimetype -> view function mapping
Fixed some db querying syntax for the move to 7
Merge pull request #1 from daniel-dgi/7.x

7.x