[Core] Refactoring index and get_uri method (fixes #10).

A small refactoring, I think that using a dict is easier to read and maintain,
and normally it is also a bit faster.