categories added and pageIDs now incorporate category, lots of fiddly stuff too