Hamilton-Jacobi theory and integrability for autonomous and non-autonomous contact systems