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

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.
a couple of fixes based on review comments
changing the centering behavior to only center when the cursor is
either near the edges of the viewport or outside of it entirely.
This results in less hopping around when performing searches.
remove direct calls to editor.centerOnCursor by incorporating centering
into the calls to setSelection in findNext and replace, per feedback
from pflynn
centerOnCursor now has clearer variable names
centerOnCursor adjusts to handle the menu bar area on top, and the status
bar adjustment is no longer hardcoded as a constant.
Merge pull request #2475 from adobe/dangoor/cm3centering

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