Segment modules

Here's the changes I made last week, separating things more fully into three modules including configuration and things.