Env facts added

This should be used instead of #4051, it uses python instead of shell out also puts comments explaining why i filter 0 length keys and ignore errors