A start to organizing drive

The main function in drive is too big.  A few functions have been added to
begin compartmentalization.