Thin films for photovoltaic and related device applications