Add full gate implementation and achieve remote connection to the RibbonServer;
Some fixes and comments added;