Added Tag saving into the database.

Available for now:
* set tags on documents
* retrieve tags assigned to a document