The dynasty lost control of peripheral territories bit by bit. When was the Tientsin Massacre?