Merge pull request #1 from sgoodwin/master

Fixed references to the class from inside the class.
Move url path and query logic to class method
Refactor for clarity
Change path escape logic to only escape spaces