pagepreview: Split into reusable components and added some docs.

See #17.