Detroit to demolish thousands of homes as city shrinks