Costa Rica elects maverick Chaves as president in break with establishment