Add logging for Node.prototype.removeChild and small refactor