Simplified Registration code and clean up

Simplified the server side registration code by using pre methods to
check whether the given username or email exist or not. Also cleaned up
code on client side to handle registration errors better and deleted an
old register.html file.