Context-root, repository and other changes

Hello,

Thank you for your work on this module. I found it very useful.

However, I needed to make some changes to allow custom context roots and also merge in a possibly empty repository path. The commits 21e65b9 and ce87e1b contain these changes.

I went overboard with the rest of the changes. You may discard them if you think they are not required. However, I do think they are a good idea.

-m