merge performance tweaks and node visiblilty fix from mapjs