Split the Delegate system to use smaller more functionality contained delegates.

Also made a user login and register system. I should have split these commits.
But forgot to commit the latter first and now the changes are to intertwined.