Move zipfile backport to somewhere shared and fix tests.