Implement adoptNode

Fixes #92
Merge pull request #93 from arv/adopt-node

Implement adoptNode