Fix bug and add a test version of ControllerBase
Fix a bug.

When a user that wasn't loggged in visited a user's page
there was an error. Fixed that.
Move dispatcher logic from index.php to ControllerBase; change static controller method calls to non-static
Refactor dispatching to achieve DRY in protection from CSRF forgery
Now all the forms are created with the help of a class
Create token in the Form class
Rename produceError to createError
Fix wrong number of tabs in a line
Add a whitelist of types
Fix a bug and do some refactoring.

-Now the forms can have 'get' methods too.
-Image upload works.
-Fix some XSS problems.
Do resource and method protected instead of private
Combine declaration of arrays, add max and min age to config
Permission stuff