Refactor: UniqueIDs and IMFactory (now ObjectFactory). And more comments