Mazepa, Ivan Stepanovych, 1639-1709