Reconstructing ontogeny using gene expression