add linear 2d encoder; fix neighbours for 2d and 3d; add isolated-2d demo