Remove a large amount of convoluted code that did not play well with Windows