Refactor position code into utils.

- Per request, create helper methods for calculating a points position on a
scaled/transformed canvas.
- Create helper for finding the center point of a relation line.

QA
-----
To QA make sure that the menu pops up in the right place and things like ambiguous relations work as they should. A good pair of charms to check for this are mediawiki and mysql as you get the option for a slave db.