add writing out of category pages, some data adjustments