Control of thermal and optoelectronic properties in conjugated poly(3-alkylthiophenes)