Basic layout of apt functions and logic.  Some TODO's in there.