Make env param a dict type instead of list

Also modifies param type checking code to remove whitespace from
around params before splitting them into k=v pairs.

Fixes #8199