working version with a hacky ORM and cached page records for category ns