Refactor the page class to separate the HTTP status logic. Fixes #1571