Add login logic and a bunch of other things.

This patch adds a bunch of functionality.
Revamped the login to make it more versatile (the callback function is a pain).
Registration should now work too.
Added some temporary error strings (will fix the French at some point).
Revamped the error message system. Use show_error and clear_error to display them.
Merge login template.