Revert "don't need dependency on ERB"

This reverts commit 3c9d3809b649f542f51e7ebcc7bb7b662633caa5.
Revert "use request_uri & ERB::Util.url_encode"

This reverts commit 8f8f025292005a5d720dc844aeb794d2773de805.
encode with CGI.escape like we did.  request_uri
needs to be used instead of path