MDL-44316 test: added function to generate a tag
MDL-44316 core: updated the 'tag_instance' table to store the component, contextid and timecreated
MDL-44316 core_tag: changed the API to accept a contextid and component