merge rewrite and rewrite_manip modules