Fix for PyQt < 3.8. The BlackAdder generated files are now hacked (again) to eliminate an attibute error for WState_Polished. Also, backreferences are now supported in the replace output.