Make popup close more generic, cleanup some code and added some tests.
Merge pull request #49 from wix/popup-close

Make popup close more generic, cleanup some code and added some tests.