Refactor Environment to use pkg_resources

Change-Id: I548dfb843578277e3e522cb03d928909a14d3508