Adding check for node to closest check so that it will not raise if parentNode is null (not in the DOM).
Merge pull request #135 from jetheredge/2.x-beta

Adding check for node to closest function