added GATE-Functionality + test;
GATEPORT has to be set per iteration - otherwise unset would not be
commited