Increase performance of layers

* Now layers take only the minimum required size
* Now cache all the points and text of the layers, to make search when
  selecting faster