Improve command line option handling - submitted by Simon Lundström

Change the order in which configuration is loaded and defaults are
applied.
test for the 'default node in config' case
use just one naming convention for the test config files
de-couple option setting from exception handling
Catch specific exception and assert explicit --config is present
Strip unused function
copy over the test (default) config before executing the test cases
Trailing whitespace
Revert change that broke tests on python 2.6.
Merge bug25711