Fixes and additions to the gateway. Fixing one typo in the documentation and adding one convenience function, withGateway.
Updated the Ping program to use withGateway.