Add encoder and decoder for double arrays