Fix file uploads, wrap up globals

A bunch of other fixes such as switching register page to use new form
function, switch to use display_success, dislpay_warning, etc.