Intermediate checkin of ported model code.