Referee fixes

f getFigureFromDirection fixed
f getDistance params changed to coords (it is more convenient)
f some fixes for test