refactor rendering system.

Now rendering system uses limited amount of memory, which size is specified during initialization of the application.