Very, very cool! Definitely some code I'll be pouring over the rest of the weekend.
I like the idea of using a mix-in for this.