Added unit tests: views and status api.
Fixed bug in the triggers.
Added several unit tests related to triggers.
Fixed several bugs in triggers.
Merge branch 'dev-tests' into dev