This is great -- when I first read the weird ClassTag pattern I was puzzled about its apparent dishonesty. Rebased and changed, here and elsewhere.