bring modifications from branch NEW-GATEWAY to branch MASTER

There was interresting development done in the NEW-GATEWAY branch.
Sadly NEW-GATEWAY branch was based on Kalkun 0.6
This commit brings old development into current MASTER branch.
Intended to be a fresh start for more coding :-)