refactor links controller collection.
sort links#index by source.logic

Sort the links in an index view by the logic of the source-ontology of
the link.

Also extract the search-triple ontology_id, source_id, target_id into
its own method.
optimize links controller further

Apply special order to links collection in every
case.
Also set @links instance variable in every case.
And cut down on the obsolete/duplication.
Merge branch '482-sort_mappings_by_source_logic' into develop