add rewrite class and activate/deactivate/uninstall hooks