Fix insert_text_replacing.
Don't use prototype way of clearing an array.
Correct methods of positioning.
Assorted fixes.
Replacements for Prototype delay/defer.