Costa Rica are through to the quarter-finals of the World Cup for the first time in their history after beating Greece on penalties.