Allow HTML viewer to be used as a library