The logic of the reverse mathematics zoo