Fix screwdriver code style and add protection support

No more leaking globals or backwards protected doors. :-)