added gateway support

A gateway can be specified in config.cfg within a [connection] section.

example:

[connection]
gateway = hub.example.com
added documentation and simplified code
fixed typo
Merge pull request #174 from tobami/fix-argparse-bugs

Fix argparse bugs
Merge pull request #171 from hojerst/master

added gateway support
Merge branch 'master' into version-2