fix #1974 and #2413: center the line of interest

(targeting the correct branch)

fixes for #1974 and #2413 

this change adds editor.centerOnCursor and a center option to
editor.setCursorPos and editor.setSelection and then uses that
API to center find/replace results, go to line results and
go to definition results for JS, CSS and HTML.