Restructured htmlwriter class for more general purposes (including frame box number functionality) and added child class in plotpages.py