Implement theme hierarchy

Ref #922
Ref #783

Not done yet: top-level themes without powerline or unicode characters.