rewrite of file module

Need some doc, and ready for prime time!