Puppetmaster Refactoring (puppet::server)

Not yet well tested yet. Just posting PR for comments