Class assignment and selection for Raphael

Preliminary pass; I only just started looking at D3 and Raphael source code a few days ago so please let me know if I went wrong anywhere philosophically or stylistically. I also haven't written any tests, but I don't want to do that until the approach is at all validated.

In particular I'm not terribly certain if some of my direct node manipulation is considered okay.