Devirtualize File::kind.

This is the standard way of implementing LLVM RTTI.
Devirtualize Reference::kind.

Improves performance.
memcpy instead of copy_n. Faster than copy_n on MSVC :(.