Move level and security tests.
Assert on security validation errors.
Tidy error assertion logic.
Assert on throw error.
Refactor error test expectations.

So that there is a central function for asserting on error conditions.