Port RemoveTicketsForUser, finish porting database tests