Added reverse() to rules class and fix bug in rev_regex.cpp.