[MRG] Supporting non array subclasses

The support (and test) for y being not an array subclass is implemented, but I still need to work on X.
I don't like so much copy & paste :-/ I'm not sure what a good alternative would be, though.