Extension on/off state improved

Now the state will be stored in the local cache and not rest back to
'on' every time the extension reloads.