The synthesis and analysis of polymers and small molecules for use in organic electronics