Ensure that unused tags are removed from the tags table

I believe this fixes issue #66, which happened to be something I wanted too :)  I've only tested this with PostgreSQL.