Formation of high-performance photovoltaic materials from solution