Fixed broken retry code for sendasync.
Added simple class for managing persistance in the agent.
Merge branch 'master' of https://github.com/electricimp/reference