Improve nodelist API, with basic unit tests