Implement adoptNode

Fixes #92