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

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