Basic user editing tests

still WiP and uses private methods so need to improve
add a tokens table

Initially used to confirm email address changes
WiP user email changing and confirmation

Still needs to checks for changing existing user, updating alert emails
and actually sending the confirmation email, plus tidying up
email confirmation URL redirect
split is deprecated so use explode
tests for email confirmation

Does spit out an error page due to login redirect at the moment
check that the email address the user is changing to isn't already used

in process fix email_exists to be able to return the id of the user with
the checked email
space/tab consistency fixes
send email confirmation when user changes email address
optionally do not send confirmation email in user->update_self

To prevent sending mail during tests
optionally do not redirect after confirming user email

For use in tests
once the email address has been confirmed delete the token

just becuase it's tidier
email confirmation tokens expire after 30 days
tests for alert email changing plus fix to make it work

Where the setting of the email address for the THEUSER object was
happening meant that the alert updating code was not being run so assign
->email once the update has been succesful. This also makes more sense
as it means the email has been updated rather than assuming it will be.
Merge branch '181-user-email-change'