@jverghese This library came out recently too. Could draw some inspiration from it if we want to make generic svg manipulation functions.

https://github.com/wout/svg.js