FINALLY ... rewrite some of the file routines:  specifically fix race condition on close of async files and remove tons of redundant code.