apply & merge optimizations from : https://github.com/jack-pappas/fs-core-optimized , thanks to Jack Pappas
revert set.fs optimizations due complicated conflicts