Ah, hoisting.

Ugly feature of JavaScript. It's very convenient during developement and also for readability, but can be painful while debugging and especially in code maintenance (refactorings).

In general, we should strive to have the same approach accross the code base. In dev_catalogtree, I have a mixture of both, for instance.

For this PR, I would leave it as it is. @cedricmoullet Please merge if you're satisfied.