SVG util: replace jQuery selector with own traversal

Using jQuerie's selectors to traverse the SVGs resulted for large SVGs
in a 'Maximum call stack size exceeded' error due to some recursion
going on in jQuery. Therefore, these selectors have been replaced with a
custom (iterative) traversal function. This fixed the error and large
SVGs can be traversed as well.

Related to acardona/CATMAID#840