Factory is now able to call arbitrary callbacks when instantiating objects.
Rearrange code.
Implement and use new logging service. Also, some cleanups.