Don't call sys.platform so many times ...

Making it a function parameter will make it a testable function
Gee, printf ... to much C lately ?
Simplify get_conf_options

Break down the long and complex function to smaller
and more testable units
pep8ify
Simplify how startup script end

The complex exits structure was simply not needed
Add set_umask logic to a function

Continue the 'divide and control' refactor
More 'divide and control' to startup script

Move the startup process to __main__ name space.
This will allow importing all the function and
hence it makes it possible to test them.

Add two more functions:
 - set_algorithm
 - set_db
Move get_ui_platform to pwman/__init__.py

This allows reusing in the test suite, thus we can
remove the same code from the test suite.
Update copyright
Move all imports to top of the file
Reorganize the messy imports in db_tests.py