Closes #60: implemented cosine similarity function.