added support for virtual host based rewrites

-Made some changes so virtual host based rewrites are possible as a part of the configuration.
-Added some example rewrite rules.
-Some improvements of the rewrite module itself.
-Changes to the virtual hosts module to reflect the made changes.