Make listCookbooksInEnvironment return empty set of CookbookDefinition on 404.
Added tests to validate above. Also factored out some duplicate code in test.