Adding https handle on apache puppet.

Have not tested it yet. Just committing for Danilo.
Also refactoring the controller to get a better understanding of the
events.