Use nio for file encoders.

Lets just merge this now, I don't know when I'll get to the StaticFile stuff. I think it has value in its own right, but may need some spring cleaning.