Much moving of stuff around to accommodate the separation of the API
from the implementation.