makes endpoint_uri a configuration element

makes configuration.endpoint_uri part of the config block.
made changes in connection class to use this rather than hardcoded.
I dont understand rewrite URI method, but it looks like it may need to be updated