Move string submission to connector class.

This moves the main string submission function and its helper functions
to the string submission class.
Switch on http response status codes.

Using a mess of if-else statements was not going to scale well.