fixes #6856 - API v2 - more efficient import puppetclasses for single environment

```@environment``` is not set at this point for your tests - which is OK and I'm glad your tests revealed this. 
The reason why it's not set is that the before_filter ```find_optional_environment``` will not find environments like ```env1``` or ```env2``` in your tests, simply because they don't exist yet. 

Instead, let's use 
```ruby
if @environment.present?
  opts.merge!(:env => @environment.name)
else
  opts.merge!(:env => @env_id)
end
```

```@env_id``` is always defined, and it can be an environment that exists or doesn't exist, it doesn't matter. The Proxy will import the classes and environment properly if it doesn't exist. And if it exists, it will use the handy ```@environment``` variable because ```find_optional_environment``` worked.

Summing up, ```@env_id``` will be used when users try to import classes from environments that are not in Foreman, and ```@enviroment``` will be used to import classes from environments existing in Foreman. From the user point of view, this is seamless and the use of these variables is 100% internal and hidden, they have the same API as before (even better, now they can import classes from non existing environments)