Hierarchical config

So, rebased. Any comments before merging?