Get rid of pointer arithmetic stuff in the encoder and decoder wrappers. This can all be done by just passing the array. Turned off allow unsafe code, since it's now all safe.