use current cell's type when inserting

this preserve all previous behavior, but simply adds the ability to
insert cells without specifying a cell type, in which case the cell type
is inferred from the currently selected cell
inserting new cells preserves type  closes #4917