Re-enable TestApplyLayer and make it work

This re-enables TestApplyLayer and makes it work by re-implementing ApplyLayer() using the archive/tar go tar support.