fix remarks in systemtools.py (PR #694), add enhancements and unit tests + sync with develop

fixes remarks in https://github.com/hpcugent/easybuild-framework/pull/694, and more (e.g. unit tests)

@wpoely86: Because this also contains a sync with the `develop` branch in which a huge PR was merged recently, this will look very messy.
You can either only look at the differences in `systemtools.py` (see commits 258dd42 and 17c5458) , or sync your `cpuspeed` branch with `develop` first to get a clearer view here.

I touched `systemtools.py` quite a bit, so I'd like you to review my work there before you merge this in. Do let me know if you have any remarks, I will handle them before you merge this PR in.

In any case: this should make #694 ready to merge, so it should go in for EB v1.8 if you handle this in the next couple of days.