* some code cleanup in gateway
* parts of code deleted or moved into modules
* now transport should not write null exceptions
! update may cause errors, revision didn't tested well