Also fixes some bugs with docs graph having classes split into more than one db/ident. Part of LOG-3176