Implemented ability to choose TCP or HTTP connection methods.

All 107 tests pass. The HTTP method (via POST) seems to be faster and more stable.