Analysis of contact Cauchy-Riemann maps III: energy, bubbling and Fredholm theory