Some documentation and some cleanup; code should now work identically on mac and windows too I think