Document second argument to replaceSelection
[javascript mode] Handle non-typical for-initializers properly

Closes #1418
[closebrackets addon] Clean up c1b7ea430aca76aaad9ce1c79990086f10a14c04
Use a slightly more complicated heuristic for adjusting cursor pos at start of change

Issue #1415