Port first part of proxy function tests.

These cover connections timeouts/issues etc.