Var definitions was replaced to the top of a function
undefined vars checking was added
Some refactoring in youreditor