* Do locking & logging in a central place.
* Fixed scope.
* Make mods proper instances of a class. Drop all the static foo.
* Register name in __constructs.
* Fixed indentation for rest of project.
* Fixed logging call from mod.class.php.