Specify the size of memory as a parameter to NewBasicMemory
Modified BasicMemory to allow disabling reads/writes.