Converted encounter form to new security model
Logic fix in user verification.
whitespace cleanup