Added tests for objects with foreign keys.
Restored SQL tracing.
Add tests for many to many.
Adjust logging.
Fix many to many fetch.