Cleaned up a bunch of things and moved the work into parallel threads.