move rst writer to a different function
move rst writer to a different function

this simplifies and clarifies the code, although we need to call the writerst function twice to wrap up at the end of the loop

shamangeorge/beets,ibmibmibm/beets,jackwilsdon/beets,beetbox/beets,ibmibmibm/beets,SusannaMaria/beets,SusannaMaria/beets,beetbox/beets,beetbox/beets,sampsyo/beets,ibmibmibm/beets,SusannaMaria/beets,shamangeorge/beets,ibmibmibm/beets,SusannaMaria/beets,sampsyo/beets,shamangeorge/beets,beetbox/beets,jackwilsdon/beets,jackwilsdon/beets,jackwilsdon/beets,sampsyo/beets,shamangeorge/beets,sampsyo/beets