Added functions to return node objects to model.js.
Merge previous commit with Brett's commit.