Second Order Variational Problems with Free Discontinuity and Free Gradient Discontinuity