Add setActiveTemplate helper
Close the template

Menu.buildFromTemplate modifies it so copy before hand
so it can be reused
Store each window's menu template

Restore it when the window gains focus
Compare templates before swapping them out
:memo: Add template
Merge pull request #3906 from atom/ks-change-menu-on-focus

Swap out application menus on focus