Updated form validator to cope with basic file uploads

Uses the HTML5 FileReader API to encode the file as a base64 data URL
and send it to the server-side form validator in the usual fashion.