This was causing blender to segfault.
We now add create a new collection and link to the layer before adding
the new object
(also included unittests, and requires updated lib/tests)
Some tests may break Blender, which makes the entire unittest routine to fail.
They are now I isolate the tests into individual files
Kudos to Sybren Stüvel and Sergey Sharybin for the advice.
Note: at the moment test_link.py is failing (since a41bbfb7)