Checking if object already exists before assigning a handle to it.

Whenever an object was searched multiple times, it would receive multiple handles, as if there were more than one instance.
Now it checks if the object was found in a previous search before allocating a new handle.
Testing of module's functionalities
Adding missing test