MT#3925 Use forms for validation only; other fixes

Don't use JE for data validation, as it adds lots of processing overhead.
Properly use Formhandler for data validation.
Catch DB errors properly.
Write basic auth test.