Fixing defer note bug and closing unclosed divs

When defering the note dialog was passing previous defer-notes. By
clearing out the dialog div before closing it this problem is fixed.

Also fixing a bunch of <div> tags which were not being closed.
bug-fix: 0 not accepted in MAT (alternation)

0 was rejected due to bug in preg_match - fixed
Merge remote branch 'origin/release' into develop

Conflicts:
	api/ui/push/test_entry_alpha_numeric_edit.class.php