Serious (JS) code refactor

Meanwhile fixed issue https://github.com/matthiasmullie/minify/issues/10