Initial working registration/signup logic. Proper logout handling added.