Litedown: removed superfluous var declaration in JS
Reworked some code to help code analysis. No functional change intended