Node lists rewrite

This 

- Fixes #605 and adds a test for it
- Makes some substantial changes to how nodeLists operates
- Changes the location of node_lists.js
- Includes a lot of improved inline documentation.

A nodeList now knows about its parent and child node lists so it is able to update them more effectively.