WIP: add support for returning module contents as HTML

This still needs tests and probably has bugs like:

- what to do when the content is a collection
- pattern matching fails when trying to include file extensions