Got live email checking working.
Moved entire register script to seperate file.