Refactored a lot of code. 
Added new annotation for defining a test policy.