Added environment class, some tests and documentation.