Change rewrite config into proper object handling, and minor change of builtin rewrites