Fix issue 252 - Add reconnection option

This is a first swing on adding `reconnection` option.
We kind of need this to be added to test with Mobile-Appmaker and also to deploy to server where WebSocket will be close when there is no activity from client to server and likewise.

Other options can be added later such as reconnectDelay and many others as suggested in the ticket #252.

Unit test for this will be add ASAP, but I want this to be review at least to be sure what I'm doing here is what we need.
actually wait I think its just better to pass the function as a parameter to init so that you can assign it to onopen in the syncmanager.js file. But yeah probably just move the onopen to that file