Move titling out of writeHistory block, fix typeof undefined
Add missing page titles