It evolved organically. Long before the Council was a formally defined entity, government leaders in the member states of the European Communities would meet periodically to discuss plans for the functioning of Europe and the direction of future integration. This was formalised with the Maastricht Treaty, which defined three key institutions that would be the pillars of the EU.
The Commission is supposed to represent the interests of the Union, the Council the interests of its member states, and the Parliament the interests of its citizens.
Sorry - just visiting again and saw this thread. There is an additional irony with regard to the non-binding nature of the referendum. It was ruled that there were significant irregularities with the vote leave campaign, namely that they spent more than they should have. If this had been a binding referendum, then it could have potentially have been ordered rerun by the courts. However, the courts cannot do so with an advisory referendum.
Also, you mentioned earlier why there was a problem with rerunning the referendum now to see if people want to leave now we have a clearer idea of the deal we will (or won't) be getting. The argument tends to be that it would be anti-democratic to rerun a referendum before the thing that the first referendum was about was implemented. This would be because if the government didn't like the result they got, they could keep running referenda until they got the result they wanted.
My personal take is that the first referendum was anti-democratic. It was just terrible. No supermajority required. No minimum turn-out required. An assumption that remain would win, so no clear idea of what leave might be (which in played into the hands of leave, who ran two independent campaigns promising different things to different people). David Cameron might end up being responsible for one of the most significant political mistakes in living memory.