Change order of file and directory discovery process
Cleanup method of finding python installation prefix, remove unnecessary comments, standardize code formatting