add proxy support

...and tests cleanup.