Split out worker code into its own module. Still refactoring cluster.