Fixes #8 cleaned up code, improved docs, handle some RewriteRule flags