Markdown Editor clean up.

A little clean up after the fix: https://github.com/discourse/discourse/pull/2223
Makes turning off preview scroller related conditionals a bit cleaner, uses simpler and faster markdown rendering algorithm when syncing is not needed and fixes two missing `var` declarations.