Improve counter handling (fixes #440, #710)

If an element that increments a counter was rendered but pushed
to the next page because of lack of space the counter would be
incremented a second time. Now when splitting an element dompdf
will decrement counters that were incremented.

Also, nested counters would break depending on where the paging
took place. Because dompdf reset counters as it climbed up the
element tree higher levels of nested counters were being reset.
Now dompdf saves the current value of any counters on an element
that is split. When that element is re-rendered on the next page
the counter value is set according to the saved value.

Additional modifications improve improve handling of the use case
outlined in #705.