[WIP] Configuration Trees

(See https://trello.com/c/wpI2gX5I/13-configuration-trees.)
[You don't have to reply to these. See my main comment.]
Recursion should be changed into a loop for performance because there's no added benefit of recursion in this case.