panic/recover on module Attach/Detach errors.

Previously errors were just ignored.
Adds content-type test for HtmlView.