Stripped down and separated, then re-added parts when understood its function, and modified as needed. The current test.d now functions (on Windows at least).