Reorganize the sys.path updating code a bit to make it more clear what's happening.