Update anchors.js

removed the 'crude method of determining orientation between two elements' and replaced it with a method that does what the TODO said.

reason: the previous calculation did not apply the bottom for sources at all, except if the orientation was found horizontal. The different handling of top and bottom made for unsightly graphs in my application.