Filter out empty environment variables
Reorganized both shell and non-interactive mode
Introduce a separate library
Use /proc/xxx/environ as per kolypto's upstream commit