Hybrid perovskites for photovoltaics: Insights from first principles