Mode in the stats object now encodes the file type.

We need to be careful about mutating it willy-nilly.