Large refactoring

but it will setup almost all that is needed, including puppet modules