Improvements in synonyms extractor

* Significant optimization of the similarity scores calculation algorithm
  due to the introduction of helper indices for dependency triples
* Code readability improvements
* Bugfixes in the analysis.synonyms endpoint