Added tests, better docs, and condensed code for process_windows