Move server logic into a new package

This simplifies main so it deals with generic setup, flags, and termination.
Add container package and TODOs