Fix #226: Selection survives a store notification.
Fixed some bugs and created a test page.