Remember nodeSpace, zoomFactor

... plus some JS fixes/cleanups

tiny PR, but it's late and someone should probably look over it.