New foundations for Z