Huge cleanup and rebase. Should fix #2 for those using windows. Linux and Mac, hang on.