Added SNAPConnect init logic.
Refactored a bit and added SNAPConnect polling to loop.