Code cleanup and improved thread safety
Merge branch 'master' of https://github.com/muntashir/Pingo