remove window.markdown global var, update setTimeout for promise-like pattern, jslinted.

oh I didn't test, did this @barisusakli promode.