Update and format main.py

Reworks the Input class to not be a dict, instead be a regular object. This means that you can't do input["conn"], but I don't see a need to.

This also changes the dict(input) to input.__dict__ in the log.py plugin. This fixes it when Input isn't a dict, I'm not sure why though.

Changes the complicated double-negative autohelp statement in dispatch to something that makes more sense:
```
-    if not (not autohelp or not args.get('autohelp', True) or input.inp or not (func.__doc__ is not None)):
+    if autohelp and args.get('autohelp', True) and not input.text and func.__doc__ is not None:
```

Adds type specifications in all function documentation.

Adds a more complicated argument checker for plugin functions, that supports both the new and the old plugin format.