Store index table open/close state in location.hash to include it in the browser history

Limit open category to one to allow storing it in the location.hash.

Also restore open/close state on popstate event to make it work with browser
back navigation events.