Automatically flush rewrites when a new theme is activated

fixes #9