The solar company plans to lay off 1,000 employees and close most of its direct sales operations to reduce costs and focus on dealer networks.