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 'staging' into 482-sort_mappings_by_source_logic

Conflicts:
	app/models/link.rb
Merge pull request #934 from ontohub/482-sort_mappings_by_source_logic

482 sort mappings by source logic