lua : fix an unbalanced call in type registration
lua : fix incorrect calls to pop
fix a minor memory leak in tags
lua add tag support

dt.tags.# : each tag is indexec by a number, use ipairs to iterate
dt.tags.create(name) : creates a new tag and return it. returns the existing tag if it exists
dt.tags.find(name) : returns the tag object or nil if the tag doesn't exist
dt.tags.delete(tag) : deletes the tag object, detaching it from all images
dt.tags.attach(tag,image) : (parameter order can be reversed) attach a tag to an image
dt.tags.detach(tag,image) : (parameter order can be reversed) detach a tag from an image
dt.tags.get_tags(image) : return a table with all tags attached to the image

tags object have the following structure
<tag>.# : each image attached to the tag has a numerical entry
<tag>.name : the name of the tag
<tag>:delete() : deletes the tag
<tag>:attach(image) : see dt.tags.attach
<tag>:detach(image) : see dt.tags.detach
<tag> also handles tostring and equality correctly

the following method have been added to images
<image>:attach_tag(tag) : see dt.tags.attach
<image>:detach_tag(tag) : see dt.tags.detach
<image>:get_tags() : see dt.tags.get_tags