Catalonia elects separatist leader as president