Refactors code.
Update node to use shared_ptr for referencing parent node.
Updates node tests to adopt to class changes.