added write support for tag emulation, cleanup tagemulation class

Signed-off-by: Armin Wieser <armin.wieser@gmail.com>