Refoctor get_link_id().
Rename functions and members for link operations.
Implement compare_hash_link_by_ends and hash_link_by_ends.
Implement lookup_link_by_ends().