Return a RNG state that can be saved to file

At the moment, the state contains a FFI C structs that cannot be saved to file. Need to fix this.