Split insert from footer in leaf rewrite.

See #356.
See #355.
See #107.
See #4.