Beginnings of a backtracking best-fit page builder. If it breaks you get to keep both pieces.