Fix SVG insertBefore/insertAfter when wrapped in <a> when setting "href"

When an element has an "href" the node is wrapped with an `<a>`. `insertBefore`/`insertAfter` did not take this into account (#631) and would throw errors when attempting to remove an element later on. Additionally, `remove`, `toFront` and `toBack` now use the new function (reducing code duplication and size).

[Here's a fiddle](http://jsfiddle.net/Py67Q/) with a test suite.