introduce cleanup handler

when reading needles we need to throw some away that don't match the
tags. In interactive mode needes are re-read so there needs to be a
handler that is called on init. Therefore introduce a callback.