changes to the rewrite module

made some changes to the rewrite module (minor bugfixes and some improvements) and did remove the now obsolete parser code