Extract test functionality

Fix #101.
But if we accept `null`s, the defaults in the Proxy classes will get overwritten. Or do you mean to only set (e.g.) the port if it is not null, so move the `if`s to the Proxy classes?