Fix bug in `empty` method

Ensure that when a node is empty, the childrens' `parent` reference is
destroyed.
Add performance optimization for  `empty` method
Merge branch 'pr/352'

Conflicts:
	lib/api/manipulation.js
	test/api.manipulation.js