More function moves and build fixes; now builds.