Molecular, supramolecular and environmental effects on the photoswitching of side chain photochromic macromolecules