add package.json
use delete instead of setting node to null on pop
shrink _tree on pop