Set header correctly for investigations.

fixes openhealthcare/elcid#150
Fix bugs with related model names in queries.
Add reportview.

refs #197