#62: implemented cosine_distance function, added to interactive API.