added scheme replacement for emails.
Added path test case.
Merged DaveRandom's code.