Fix alignment of text boxes

* proper handling of cases with both vertical and horizontal alignment
 (see chapter 17.5.2 Basic Placement Options of pgfmanual)
* improve comments
add test case
adapt with suggestions from @okomarov

* simplify code
* remove "inner sep"
Merge pull request #491 from PeterPablo/fix_getXYAlignmentOfText

Fix get xy alignment of text