Ernesto downgrades to tropical storm after battering Bermuda