Tunisia's president has announced a state of emergency, a week after the killing of 38 tourists at a resort. The military and police now have extra powers.