Ranks and kernels of codes from generalized Hadamard matrices