BatchProducer: bug fix and cleanup

- BatchProducer should run in daemon mode and should die when the main process dies and all messages should be flushed.
Merge pull request #10 from sholsapp/batch-producer-fixes

BatchProducer: bug fix and cleanup