WebWorker: refactor and remove MaybeNDArray class