Cluster expansion of the wavefunction: Valence and Rydberg excitations of trans- and cis-butadiene