Fix nil bug

Fixes #259.

The first commit fixes the issue, which is that although @port was being set, @uri.port was not. The committer of 043eb0 probably got confused by the two different ways to set the port, so the second commit refactors the class to get rid of the instance variables (@port, @host, @path) that duplicate those already contained within @uri.