Refactored the inline thread that monitors the master and turned it into its
own class. The pool shuts down the monitors as well now.