Fix for	#40. Also, add class to SVG output if it has been set for certai...

...n nodes

Please merge this in so people can also export 'class' attributes..
I also fixed #40