Make use of occur-mode machinery for occurences

Occur-mode has some useful machinery that we can use. This involves getting a bit more friendly with the implementation than I would prefer, but in return we get a better UI and nice occur-mode features like occur-edit-mode without having to reinvent them.