ILSGateway, EWSGhana changes

http://manage.dimagi.com/default.asp?148847#837455
http://manage.dimagi.com/default.asp?134684#831319
http://manage.dimagi.com/default.asp?148852#831253
changes in checkpoint according to discussion in google group.  
@czue @twymer
Common code for both projects moved from commtrack.py file(https://github.com/dimagi/commcare-hq/pull/5092/files#diff-bc7f39e2cd9dc408b7bf24925feae182L76)