Support drop file into the code block

Will replace content (instead of appending by default), set the new file
name and the appropriate mode.

Also add more convenient options for CodeMirror.