Fix shelve edit not close

For as long as I've used this addon the edit window for an individual shelve would not close when I hit the "ok" button.  However, if I hit the "ok" button, then the "cancel" button, my changes would be saved (well most of them), but there would be no error message.

This was caused by having the autoselect feature turned on, which allowed shelve.setupAutoSelect to be called from the modal dialog.  This was a problem because shelve.setupAutoSelect called shelve.addEventListener, which expects to be called from a browser window.  So an uncaught exception was generated.

The first change fixes this issue by calling shelve.setupAutoSelect for each browser window.

The second change refactors the code to allow the removing of the auto-shelve listeners if all shelves have the auto-select feature disabled.