Create a definition, add it to the library, and return the definition
name - (str) the name of this instance
properties - (dict) the dictionary which holds the properties