What events led to the czar abdicating in 1917?