Manage frequency of menu update

- Ensure menu generation only happens when needed
- Ensure menu generation occurs when switching windows
Handle menu file write err gracefully
Ensure plugin is working with absolute paths