Implement new external block reference lookup

Migrated from #135