Make Rewrite layer pluggable

Initial review draft. Adding Tests for new code are still pending. Am working on them Existing tests are passing.
Once all the DSLs are initied, can we log which all are inited?