Add residual syntax decoding; split out scan array implementation