core: report duplicate variables in scope hierarchy

fix #851

I have done no excessive performance testing, this might cause a huge impact on bigger scope hierarchies.
If this is the case we should consider reverting this.
Merge branch 'master' of github.com:mbeddr/mbeddr.core