Add getMidpoint method for Element

without midpoint helper method, too much code need to write:
```
var bbox = ref.getBBox();
var path = "M" + pos.x + " " + pos.y + "L" + (bbox.x + (bbox.width) / 2) + " " + (bbox.y + bbox.height / 2);
```

better:

```
var point = ref.getMidpoint();
var path = "M" + pos.x + " " + pos.y + "L" + point.x + " " + point.y;
```