Moved isEmptyTextNode to statics