For toybuild: MB-7415: fast doc lookups using doc ptr instead of id

Change-Id: Ief8d8cd38d0db79280d89a2fa1449dd5c4be01e7