Code reorg to prepare for having more than one backend.