[emacs] Fix byte compilation warnings
[emacs] Simplify and tidy up ledger-occur

Introducing a proper minor mode saves a lot of the hand-rolled fiddling
about, like managing the overlay lifecycle and the modeline.
[emacs] Don't use setq-local, which only appeared in Emacs 24.4

/cc @enderw88
[emacs] Declare when we're using cl