Generator coordinate method based on coherent states: calculation of nuclear bound and resonance states in molecules