Scope

This PR looks fine now. I need it before PyHPC, @joker-eph @pbrunet please review it :-)

It's about finding the best scope for local variable declarations...