Estonia made programming compulsory from age six, betting that a tiny nation's greatest resource was the thinking skills of its children.