Adding a live word count to the Kakoune modeline

I wanted to conditionally add the current buffer’s word count to Kakoune’s modeline.