Refactoring factory methods in functions

Classes are not need in the existing factories.
Removes unused imports
Replaces usages of "locals()"
Fixes set_static_network_config parameters

The osutils set_static_network_config method was requesting
different parameters compared to the method inherited
in the windows module.
Moves winrmconfig from plugins to utils.windows
Adds missing CONF.import_opt in password plugin

The "username" option was not imported in the password
plugin.
Adds missing CONF.import_opt in SSH keys plugin

The "username" option was not imported in the user SSH public
keys plugin.
Metadata test and metadata refactoring

Added mock based unit tests for maasservice module, baseopenstack
module and changed init module and httpservice module tests,
plugins with different imports due to utils location modiffied
and removed 3 unused imports from baseopenstack module