Javascript 2d map editor