Fixes #5419 adds tests for enabling/disabling annotations and fixes bug with deleting disabled annotations when deleting an entity