Suppose I have a program which has logical segments. How do I run each segment and have modules loaded in that segment get unloaded when I reach the next one?