Separate logic for child process queue in own module

What do you think of this? Could be made into a standalone npm module now.