Implement the environmentGet API endpoint.

Also call it to retrieve the MAAS server address when in MAAS.
Fix typo and improve tests isolation.
Merge pull request #611 from frankban/retrieve-maas-server

Implement the environmentGet API endpoint.

Also call it to retrieve the MAAS server address when in MAAS.