Correct bug in handling of repeated catch annos
Refactor security engine

Refactor to support:

 * Non-null public principals
 * Delegation of principal validation
 * Two principal validation levels