Photocurable polymeric coatings for improved stability and multifunctionality in solution-processable photovoltaics