Ilsgateway integration refactoring

PR contains changes discussed here: http://manage.dimagi.com/default.asp?134684#770914.
Also it makes integration working with refactored API(PR: https://github.com/dimagi/logistics/pull/155)