refactor(library/declaration_index): store declarations in a map

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
refactor(library/declaration_index): store declarations in a map