Move depth read/write enable/disable to js land