config: make layoutMaxDepth optional

Actually this could be an even higher value by default, but let's limit
it to 5 by default, I haven't tested larger values in practice.