Gauge invariant cosmological perturbation theory: A General study and its application to the texture scenario of structure formation