Several changes for sysinfo.

- Use with statement for os.popen()
- Further simplified some code.
- Added docstrings