mkdb: refactor the lineart code for object hierarchies

Not the lineart is applies to obejct docs and the module wide hierarchy.