Unit test improvements and minor fixes for the oae-principals module

Incorporates issue #335