Make Rewrite layer pluggable

Initial review draft. Adding Tests for new code are still pending. Am working on them Existing tests are passing.
We should move this call to LensServices.init, since thats where all services are configured.