Moved size of the diagrams backend output into the environment.

Now runBackend also creates diagrams as suspected.
Added utilities to work with custom environments.