Some improvement to subprocess handling, want to stop using shells next.