Incorporate changes for windows and make it easier to port to more lisp implementations in the future.