Changed the way on how the relationship connection points are
determined. Now they depends on how the tables center points are distant
from each other.

Fixed the problem with function parameter name not being generated due
to cached code.
Merge branch 'rel-improvements' into develop