Moved tree scan call from constructor to new compile() method in compiler.js
Basic working example