Refactored pagetools to a class; added faster method for splitting into
sections.