Move insert functionality into a new extension.
Reorganize methods and improve DocBlocks.