api changes
added before upload hook
made insertTextAtCursor a bit more readable