Martin Stolare, professor i historia