#223 Update Sphinx attributes on link creation.
 CakePHPify some old SQL code.

So that we can make use of before/afterDelete() triggers.
 #233 Refresh Sphinx attributes on link deletion.

And fix updating the lang attribute of the sentence being (un)linked.
Add test for findDirectAndIndirectTranslations.

And prevented it to return duplicates.
Fix sentences fixtures, test getSentencesLang().
Fixed update of Sphinx attributes, more tests.

We were unnecessarily updating sentences which attributes
couldn’t have changed.
Use a better name for these functions.
Optimize sphinx attribute update.

Update attributes from both main and delta index using a single call.
Turn Sphinx attributes to int for all models.

CakePHP tends to return int values as strings, while Sphinx prefers ints.
But it’s only Sphinx, so let’s put this into the Sphinx-specific code.
Don’t update attributes of flagless sentences.
Avoid talking with Sphinx for real in tests.
Update sentence owner attribute in Sphinx indexes.
Live-update sentence correctness in Sphinx.
Disable attributes update when Sphinx is disabled.

 #488
Merge branch 'dev' into delta-index

Conflicts:
	app/models/link.php
Merge pull request #525 from Tatoeba/delta-index

Live-update Sphinx attributes (2)