Add test for flag secure app

Refactored and cleaned up code.

Change-Id: I1a6f90b4562567af30c2142649a3604e8eef92c2
16 files changed